package com.sky.mapper;

import com.sky.annotation.AutoFill;
import com.sky.entity.Setmeal;
import com.sky.entity.SetmealDish;
import com.sky.enumeration.OperationType;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface SetmealDishMapper {

    /**
     * 根据菜品id查套餐id集合
     * @param dishIds
     * @return
     */
    // select setmeal_id from setmeal_dish where dish_id in {1, 2, 3}
    List<Long> getSetmealIdsByDishIds(List<Long> dishIds);


    /**
     * 批量插入关联菜品配置
     * @param setmealDishes
     */
    void insertBatch(List<SetmealDish> setmealDishes);

    /**
     * 批量删除菜品
     * @param list
     */
    void delete(List<Long> list);

    /**
     * 根据套餐查询关联菜品
     * @param id
     * @return
     */
    List<SetmealDish> getBySetmealId(Long id);
}
